/*
 *   Copyright (c) 2010-2022, SIUFUNG
 */
package net.siufung.market.base.user.controller.model.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.extern.slf4j.Slf4j;
import net.siufung.core.model.AbstractDto;
import net.siufung.core.utils.CopyUtil;
import net.siufung.market.base.user.mapper.entity.UserPost;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
/**
 * <p>
 * 系统岗位 新增数据传参对象
 * </p>
 * @author 陈建峰
 * @date 2023-02-06 23:25:52
 * @since v1.0.0
 */
@Slf4j
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="UserPostSaveDto", description="系统岗位新增数据传参对象")
public class UserPostSaveDto extends AbstractDto {

    private static final long serialVersionUID = -3158433980247312151L;

    /**
     * 岗位名称
     */
    @ApiModelProperty(value = "岗位名称", required = true)
    @NotBlank(message = "岗位名称不能为空!")
    @Length(max=255, message="岗位名称长度不大于255!")
    private String postName;

    /**
     * 岗位编码
     */
    @ApiModelProperty(value = "岗位编码")
    @Length(max=64, message="岗位编码长度不大于64!")
    private String postCode;

    /**
     * 岗位类型
     */
    @ApiModelProperty(value = "岗位类型")
    @Length(max=64, message="岗位类型长度不大于64!")
    private String postSkill;

    /**
     * 排序
     */
    @ApiModelProperty(value = "排序", required = true)
    @NotNull(message = "排序不能为空!")
    private Integer sequence;

    /**
     * 备注
     */
    @ApiModelProperty(value = "备注")
    @Length(max=255, message="备注长度不大于255!")
    private String description;

    /**
     * 租户
     */
    @ApiModelProperty(value = "租户")
    @Length(max=32, message="租户长度不大于32!")
    private String tenantId;





    /**
     * 数据标识
     */
    @ApiModelProperty(value = "数据标识", required = true)
    private Boolean deleted;


    /**
     * UserPost 转化成 UserPostSaveDto 数据领域实体
     * @return UserPost
     */
    public UserPost to(){
        UserPost userPost = new UserPost();
        CopyUtil.copyProperties(this, userPost);
        return userPost;
    }
}